﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZedGraph;

namespace UI
{
    class TabPageTXT : System.Windows.Forms.TabPage
    {
        System.Windows.Forms.RichTextBox tmpRichTextBox = new System.Windows.Forms.RichTextBox();

        public void ShowText(string[] text)
        {
            tmpRichTextBox.Clear();
            foreach (string s in text)
            {
                AppendText(s +'\n');
            }

            tmpRichTextBox.SelectionStart = tmpRichTextBox.Text.Length; //Set the current caret position at the end
            tmpRichTextBox.ScrollToCaret(); //Now scroll it automatically
        }

        public void AppendText(string text)
        {
            tmpRichTextBox.AppendText(text);
        }
        public TabPageTXT(System.Drawing.Size size, string DataLabel)
            : base(DataLabel)
        {
            this.Size = size ;

            tmpRichTextBox.Size = size;
            tmpRichTextBox.Location = new System.Drawing.Point(0, 0);
            this.tmpRichTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
           
            Controls.Add(tmpRichTextBox); 
            
        
        }
    }
     
}
